package d1113.r214.num07;

public class Car {
    private String fdjNumber;//发动机号
    private String cpNumber;//车牌号

    public Car(){

    }


    public Car(String fdjNumber, String cpNumber) {
        this.fdjNumber = fdjNumber;
        this.cpNumber = cpNumber;
    }

    public String getFdjNumber() {
        return fdjNumber;
    }

    public void setFdjNumber(String fdjNumber) {
        this.fdjNumber = fdjNumber;
    }

    public String getCpNumber() {
        return cpNumber;
    }

    public void setCpNumber(String cpNumber) {
        this.cpNumber = cpNumber;
    }


    //toString()

    @Override
    public String toString() {
      return this.fdjNumber+this.cpNumber;

    }
    //equals
    public boolean equals(Object obj){
        Car car=(Car)obj;
        if(this==obj){
            return true;
        }else if(this.cpNumber.equals(car.cpNumber)&& this.fdjNumber.equals(car.fdjNumber)){
            return true;
        }else{
            return false;
        }
    }
}
